<?php
require_once realpath(dirname(__FILE__) . '//..//pages.php');
require_once CLASS_FORM;
require_once INC_DEFINES;
require_once INC_FUNCTIONS;

authorize ();

if (isset ($html)) {
    if (!is_a ($html, 'Tag')) {
        notify('Invalid Data!');
    }
} else {
    notify('No data to load!');
}

echo doctype ();
?>
<html>
    <?php echo head (PAGE_TITLE, array (HTTP_CSS_INSERT, HTTP_CSS_MENU, HTTP_CSS_STYLE), array (HTTP_DIR_PHP_CALENDAR . '/scripts.js')); ?>
    <body>
        <div id="form">
            <?php
            require_once VW_MENU;
            foreach ($html->getInnerHTML () as $tag) {
                if (is_a ($tag, 'Tag')) {
                    echo $tag->__toString ();
                } else if (is_string ($tag)) {
                    echo $tag;
                } else {
                    echo 'Invalid data: ' . var_dump($tag);
                }
            }
            ?>
        </div>
    </body>
</html>
